﻿@using System.Web.Script.Serialization
@using DataMongo.Entities
@model string
@{
    var serializer = new JavaScriptSerializer();
    int postType = Convert.ToInt32(Model);
}
<div style="padding-top: 20px" class="span8">
    <div class="publishContainer">
        <textarea class="msgTextArea" id="txtMessage" data-bind="value: newMessage, jqAutoresize: {}" style="height:3em;" placeholder="What's on your mind?"></textarea>
        <div class="row-fluid" id="preview-display" style="display: none">
            
        </div>
        <input type="button" data-url="/Wall/SavePost" value="Share" id="btnShare" data-bind="click: addPost">
    </div>
    <ul id="msgHolder" data-bind="foreach: posts">
        <li class="postHolder">

            <img data-bind="attr: { src: PostedByAvatar }" height="50px" width="50px" /><p>
                <a data-bind="text: PostedByName"></a>
                <span style="color: #7D7D84; font-size: 0.85em" style="padding-left:5px " data-bind="text: StatusHeader"></span> <a data-bind="text:Groupid"></a>
            </p>

            <span data-bind="html: Message"></span>


            <!-- ko if: StatusHeader === 'added a new Photo'-->

            <p style="padding-left:56px">
                <div style="margin-left: -50px">
                    <!-- ko foreach: AlbumImage -->

                    <img data-bind="attr: { src: $data }" height="185px" width="125px" />
                    <!-- /ko -->

                </div><div class="clearfix"></div>
            </p>  <!-- /ko -->
            <!-- ko if: StatusHeader === 'share this'-->
            <p>




                <br />
                <div data-bind="style:{display:LinkThumbnailUrl==''?'none':'block'}" style="padding-left:56px">
                    <iframe data-bind="attr: { src: LinkThumbnailUrl }" height="185px" width="300px"></iframe>
                </div>
            </p>
            <!-- /ko -->
            <div class="postFooter">
                <a class="linkComment" href="#" data-bind="click: toggleComment">Like</a>&nbsp;&nbsp; <a class="linkComment" href="#" data-bind="    click: toggleComment">Comment</a> &nbsp;&nbsp;<span class="timeago" data-bind="text: PostedDate"></span>
                <span data-bind="text: LikeCount"></span>

                <div class="commentSection">
                    <ul data-bind="foreach: PostComments">
                        <li class="commentHolder">
                            <img data-bind="attr: { src: CommentedByAvatar }" height="50px" width="50px"><p><a data-bind="text: CommentedByName"></a>: <span data-bind="    html: Message"></span></p>
                            <div class="commentFooter"> <span class="timeago" data-bind="text: CommentedDate"></span>&nbsp;</div>
                        </li>
                    </ul>
                    <div style="display: block; padding-top: 10px;" class="publishComment">
                        <textarea class="commentTextArea" data-bind="value: newCommentMessage, jqAutoresize: {}" placeholder="write a comment..."></textarea>
                        <input type="button" value="Comment" class="btnComment" data-bind="click: addComment" />
                    </div>
                </div>
            </div>
        </li>
    </ul>
</div>
@*Scripts.Render("~/bundles/jqueryui")*@
<script type="text/javascript">
    var postType=@serializer.Serialize(postType)
</script>
<script src="~/Scripts/jquery.autosize-min.js"></script>
<script src="~/Scripts/jquery.timeago.js"></script>
<script src="~/Scripts/knockout-2.2.0.js"></script>
<script src="~/Scripts/wallpost.js"></script>
